Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Import spots from label images #79

Merged
merged 38 commits into from
Mar 20, 2024
Merged

Import spots from label images #79

merged 38 commits into from
Mar 20, 2024

Conversation

stefanhahmann
Copy link
Collaborator

@stefanhahmann stefanhahmann commented Mar 7, 2024

This PR adds a plugin to convert label images to (spot) ellipsoids.

This functionality can be handy, if a segmentation of 3D time lapse images had been performed outside Mastodon users want to make use of these segmentation inside a Mastodon project.

  • It is possible to import spots from the currently active image in ImageJ/Fiji.
  • It is possible to import spots, if they are present in a channel in the Big Data Viewer data.

Notes from https://github.com/Noam-Dori who contributed to this:

To accomplish the targeted functionality, the plugin runs twice through each image read.

Once to determine maximum/minimum values per frame for array initialization, and once to do summation for covariance & mean. It might be possible to reduce this to 1 run either by finding the min/max stored in the metadata of the image (this is a common and very useful property so it might exist in there), or by changing from an array model to a Hashmap model (at the expense of memory).

It seems mastodon draws the ellipsoid at 1σ, which only includes ~46% of the target ellipsoid. This is not what we are looking for. Therefore I set it to draw the ellipsoid at a default 2.1σ, which when squared yields the 5 in the calculation. Since this is an empirical choice I also included it as a parameter in the plugin dialog.

Replaces #47

Since during the development some memory issue during the test process occurred, this PR adds some optimizations for running unit tests for less memory consumption.

Resolves #83

@stefanhahmann stefanhahmann changed the title Import spots Import spots from Labels Mar 7, 2024
@stefanhahmann stefanhahmann changed the title Import spots from Labels Import spots from label images Mar 7, 2024
@stefanhahmann stefanhahmann force-pushed the import_spots branch 27 times, most recently from df10396 to a4a4317 Compare March 8, 2024 10:20
stefanhahmann and others added 7 commits March 15, 2024 15:43
…fully run the command and see the results

Co-authored-by: Matthias Arzt <[email protected]>
…ions in method createSpotsFromLabelImage() by SequenceDescription, which contains them both
* Results are seen with less user interaction (zooming, paning)
@stefanhahmann
Copy link
Collaborator Author

I think the user dialog shouldn't have a parameter called "sigma". "ellipsoid size factor" is probably better. The default values should be 1, and give the optimally sized ellipsoids for the example data.

That's a good idea. The sigma was too mathematical for the users. I changed it.

I'm a bit disappointed by demo classes. The don't show the plugins in action.

They exist now for both import options. Thanks for your input.

@stefanhahmann
Copy link
Collaborator Author

It's slightly disappointing that the code computes the same mean values 4 times in the current version of the code. But optimizing this will make the code a bit more complicated.

I agree with you. I decided to keep the code simple at the expense for more computations.

Copy link

@stefanhahmann stefanhahmann merged commit 25755f2 into master Mar 20, 2024
3 checks passed
@stefanhahmann stefanhahmann deleted the import_spots branch March 21, 2024 14:39
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Allow importing spots from segmented timelapse
2 participants